package com.smartao.core.init;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.smartao.core.Version;

/**
 * Application Lifecycle Listener implementation class InitServerListener
 */
public class PreServerInitListener implements ServletContextListener {

    public PreServerInitListener() {}

	/**
     * @see ServletContextListener#contextInitialized(ServletContextEvent)
     */
    @Override
	public void contextInitialized(ServletContextEvent sce) {
    	Version.touch();
    	ServletContext servletContext = sce.getServletContext();
    	ContextLoader.initContext(servletContext);
    }

	/**
     * @see ServletContextListener#contextDestroyed(ServletContextEvent)
     */
    @Override
	public void contextDestroyed(ServletContextEvent sce) { }
    
}
